<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<ul>
			<li>111</li>
			<li>222</li>
			<li>333</li>
			<li>444</li>
			<li>555</li>
			<li>666</li>
		</ul>
		<ul>
			<li>111</li>
		</ul>
		<script src="jquery.min.js"></script>
		<script>
			console.log($("ul li:first-child"));
			console.log($("ul li:last-child"));
			
			//nth-child(n)  n 从1开始
			console.log($("ul li:nth-child(1)"));
			
			$("ul li:nth-child(even)").css("color","red");
			$("ul li:nth-child(odd)").css("color","blue");
			
			//只有1个子元素
			$("ul li:only-child").css("color","pink");
		</script>
	</body>
</html>
